import os

wordList = []
arr = []
pages = "One is always on a strange road, watching strange scenery and listening to strange music. Then one day, you will find that the things you try hard to forget are already gone. "
pages = pages.replace(",","")
pages = pages.replace(".","")
pages = pages.replace("\t"," ")
wordList = pages.split(" ")
for index,letter in enumerate(wordList):
    if letter == "":
        arr.append(index)
for i in arr:
    del wordList[i]

my_dict = dict()
for word in wordList:
    if word not in my_dict.keys():
        my_dict.update({word:0})
    else:
        times = my_dict.pop(word)
        times = times + 1
        my_dic.update({word:times})

print(my_dic)


